<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../core/include.inc.jsp"%>
<script type="text/javascript">
  //重置
  $(".volunteer-list-reset-button").click(function(){
    $(".volunteer-list-div input[name='buildTitle']").val("");
    $(".volunteer_list_page_form input[name='buildTitle']").val("");
    $(".volunteer-list-div select[name='blockId']").val("-1");
    $(".volunteer_list_page_form input[name='blockId']").val("");
    $(".volunteer_list_page_form input[name='pageNum']").val("20");
    $(".volunteer_list_page_form").submit();
  })
  //查询
  $(".volunteer-list-search-button").click(function(){
    var buildTitle = $(".volunteer-list-div input[name='buildTitle']").val().trim();
    $(".volunteer_list_page_form input[name='buildTitle']").val(buildTitle);
    var blockId = $(".volunteer-list-div select[name='blockId']").val();
    if( blockId != -1 ){
      $(".volunteer_list_page_form input[name='blockId']").val(blockId);
    }
    $(".volunteer_list_page_form").submit();
  })
</script>
<%--表单区域--%>
<form id="pagerForm" onsubmit="return navTabSearch(this);" method="post" action="community_volunteer_list" class="volunteer_list_page_form">
  <input type="hidden" name="pageNum" value="${pageModel.pageNum}" />
  <input type="hidden" name="numPerPage" value="${pageModel.numPerPage}" />
  <input type="hidden" name="buildTitle" value="${buildTitle}" />
  <input type="hidden" name="blockId" value="${blockId}" />
</form>

<div class="pageHeader">
  <div class="searchBar">
    <ul class="searchContent volunteer-list-div">
      小区名称
      <select name="blockId">
        <option value="-1">--选择小区--</option>
        <c:forEach var="block" items="${blocks}">
          <option value="${block.id}" <c:if test="${block.id == blockId }">selected="selected" </c:if> >${block.blockName}</option>
        </c:forEach>
      </select>
      &nbsp;&nbsp;
      标题
      <input type="text" name="buildTitle" value="${buildTitle}" class="textInput" />
      &nbsp;&nbsp;
      <input type="button" value="查询" class="volunteer-list-search-button" />
      &nbsp;&nbsp;
      <input type="button" value="重置" class="volunteer-list-reset-button" />
    </ul>
  </div>
</div>
<div class="pageContent">
  <div class="panelBar">
    <ul class="toolBar">
      <li><a class="add" href="to_add_community_volunteer" target="dialog" width="420" height="600" mask="true" title="添加">
        <span>新增</span>
      </a>
      </li>
      <li class="line">line</li>
      <li>
        <a class="edit" href="to_edit_community_volunteer?id={volunteer_id}" target="dialog" width="420" height="600" mask="true">
          <span>修改</span>
        </a>
      </li>
      <li class="line">line</li>
      <li>
        <a class="delete" href="delete_community_volunteer?id={volunteer_id}" target="ajaxTodo" title="确定要删除吗?">
          <span>删除</span>
        </a>
      </li>
      <li class="line">line</li>
    </ul>
  </div>
  <table class="table" width="100%" layoutH="110">
    <thead>
    <tr>
      <th>序号</th>
      <th>小区名称</th>
      <th>标题</th>
      <th>内容</th>
      <th>创建时间</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="volunteer" items="${volunteers}" varStatus="st">
      <tr target="volunteer_id" rel="${volunteer.id}" class="volunteer-list">
        <td>${st.index+1}</td>
        <td>${volunteer.blockName}</td>
        <td>${volunteer.buildTitle}</td>
        <td>${volunteer.showBuildContent}</td>
        <td>
          <fmt:formatDate value="${volunteer.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
        </td>
      </tr>
    </c:forEach>
    </tbody>
  </table>
  <c:import url="../../core/pagebar.inc.jsp" />
</div>



